"""
This module contains the Box class, which 
"""

import pygame
from qnd import *

####ADD IMAGE NAMES TO THIS LIST FOR MORE TYPES OF TILES####
SPRITE_NAMES = [
'box.png',
'crate.png'
]

SPRITES=[]

for name in SPRITE_NAMES:
	SPRITES.append(load_image(name))

class Box:
	"""
	A box that the kiwi can jump on. It can be any rectangular thing the
	kiwi and enemies can stand on. The sprite number defines which
	sprite to use based on the SPRITE_NAMES list. The box object will 
	size itself to the size of the image.  
	"""
	def __init__(self, (x,y),spritenumber=-1):
		self.x,self.y = x,y
		if spritenumber >= 0:
			self.sprite = SPRITES[spritenumber]
			self.width,self.height = self.sprite.get_size()
		else:
			self.sprite = None
			self.width,self.height = 32,32
	def draw(self,screen,camera):
		"""Draw the box on the screen"""
		if self.sprite:
			draw_image(screen,self.sprite,(self.x,self.y), camera=camera)

